package com.adou.d8.thread;

/**
 * sleep，join
 */
public class ThreadTest6 {
    public static void main(String[] args) throws InterruptedException {
        for (int i = 0; i < 5; i++) {
            System.out.println(i);
            if(i == 3){
                Thread.sleep(3000);
            }
        }



        // 让当前调用这个方法的线程先执行完
        Thread t1 = new MyThread();
        t1.start();
        t1.join();
        Thread t2 = new MyThread();
        t1.start();
        t1.join();
        Thread t3 = new MyThread();
        t1.start();
        t1.join();


    }
}
